<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/layoutCourtier.xhtml">

	<ui:define name="content">

		<p:panel header="#{msgs.titrePanelPrincipal}"
			style="width:1200px;height:800px;">

			<p:panel style="width:100%;height:100%;">

				<h:panelGrid columns="2" cellpadding="2" border="1">

					<p:graphicImage value="images/network2.png" />

					<h:outputText value="___________#{msgs.titreSinistre}__________" />

				</h:panelGrid>
			</p:panel>
			<h:form>
				<p:commandButton image="ui-icon ui-icon-star" immediate="true"
					style="width:120px" value="logout" action="#{manage.logout}"
					ajax="false" />
			</h:form>
			<h:form>

				<p:growl id="messages" />

				<p:menubar autoSubmenuDisplay="true">
					<p:submenu label="#{msgs.accueil}" icon="ui-icon ui-home">
						<p:menuitem value="#{msgs.accueil}" action="versaccueil"
							ajax="false" />
					</p:submenu>
					<p:submenu label="#{msgs.menuNouveau}"
						icon="ui-icon ui-icon-pencil">
						<p:menuitem value="#{msgs.client}"
							action="#{manage.versnouveauclient}" ajax="false" />
						<p:menuitem value="#{msgs.assureur}"
							action="#{manage.versnouvelassureur}" ajax="false" />
						<p:menuitem value="#{msgs.police}"
							action="#{manage.versnouvellepolice}" ajax="false" />
						<p:menuitem value="#{msgs.sinistre}"
							action="#{manage.versnouveausinistre}" ajax="false" />
					</p:submenu>

					<p:submenu label="#{msgs.menuListes}" icon="ui-icon ui-icon-star">
						<p:menuitem value="#{msgs.listeClients}" action="verslisteclients" />
						<p:menuitem value="#{msgs.listeAssureurs}"
							action="verslisteassureurs" />
						<p:menuitem value="#{msgs.listePolices}" action="verslistepolices" />
						<p:menuitem value="#{msgs.listeSinistres}"
							action="verslistesinistres" />
					</p:submenu>


					<p:submenu label="#{msgs.menuStatistiques}"
						icon="ui-icon ui-icon-star">
						<p:menuitem value="#{msgs.sinistralité}" action="verslistepolices" />

					</p:submenu>

					<p:submenu label="#{msgs.menuAide}" icon="ui-icon ui-icon-help">
						<p:menuitem value="#{msgs.menuAide}" url="#" />

					</p:submenu>

				</p:menubar>

			</h:form>
			<h:form>
				<p:separator id="customSeparator1" style="width:190px;height:10px" />

				<h:outputLabel value="#{msgs.rechercheSinistre} : " />
				<p:inputText value="#{manage.serviceClient.rechercheSinistre}">
				</p:inputText>

				<p:commandButton value="#{msgs.recherche}"
					image="ui-icon ui-icon-search" action="#{manage.sinistresTrouves}" />

				<p:commandButton value="#{msgs.tousLesSinistres}"
					image="ui-icon ui-icon-search"
					action="#{manage.annuleRechercheSinistre}" />

				<p:separator id="customSeparator2" style="width:190px;height:10px" />

			</h:form>
			<h:form>

				<p:dataTable var="sinistre"
					value="#{manage.serviceClient.sinistresTrouves}" paginator="true"
					rowStyleClass="#{sinistre.actif?null:'sup'}" widgetVar="sinistre"
					emptyMessage="Pas de sinistre au critère de recherche" rows="10"
					rowKey="#{sinistre.key}" selection="#{manage.sinistreChoisi}"
					selectionMode="single"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} 
			{NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15">


					<p:column>
					<f:facet name="header">
							<h:outputText value="#{msgs.police}" />
						</f:facet>
						<h:outputText value="#{sinistre.police.numeroPolice}" />
					</p:column>

					<p:column>
					<f:facet name="header">
							<h:outputText value="#{msgs.client}" />
						</f:facet>
						<h:outputText value="#{sinistre.police.client.raisonSociale}" />
					</p:column>

					<p:column>
					<f:facet name="header">
							<h:outputText value="#{msgs.assureur}" />
						</f:facet>
						<h:outputText value="#{sinistre.police.assureur.raisonSociale}" />
					</p:column>

					<p:column>
					<f:facet name="header">
							<h:outputText value="#{msgs.numero}" />
						</f:facet>
						<h:outputText value="#{sinistre.numeroSinistre}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.prenom}" />
						</f:facet>
						<h:outputText value="#{sinistre.prenom}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.nom}" />
						</f:facet>
						<h:outputText value="#{sinistre.nom}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.debutPeriode}" />
						</f:facet>
						<h:outputText value="#{sinistre.dateDebut}">
							<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" />
						</h:outputText>
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.finPeriode}" />
						</f:facet>
						<h:outputText value="#{sinistre.dateFin}">
							<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" />
						</h:outputText>
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.indemnite}" />
						</f:facet>
						<h:outputText value="#{sinistre.indemnite}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgs.statut}" />
						</f:facet>
						<h:outputText value="#{sinistre.statut}" />
					</p:column>

					<f:facet name="footer">

						<p:commandButton value="modifier" image="ui-icon ui-icon-pencil"
							update="display4" oncomplete="modif4.show()"
							action="#{manage.boutonModifierSinistre}" />

						<p:commandButton value="Supprimer" image="ui-icon ui-icon-trash"
							action="#{manage.supprimerSinistre}" />


						<p:dialog widgetVar="modif4" resizable="false" width="700"
							showEffect="clip" hideEffect="fold">

							<h:panelGrid id="display4" columns="2" cellpadding="4">


								<h:outputText value="#{msgs.numero}:" />
								<p:inputText
									value="#{manage.serviceClient.sinistreNouveauNumero}" />

								<h:outputText value="#{msgs.prenom}:" />
								<p:inputText value="#{manage.serviceClient.nouveauPrenom}" />

								<h:outputText value="#{msgs.nom}:" />
								<p:inputText value="#{manage.serviceClient.nouveauNom}" />

								<h:outputText value="#{msgs.dateDebut}:" />
								<h:inputText
									value="#{manage.serviceClient.sinistreNouvelleDateDebut}"
									id="popupButtonDate1">
									<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" />
								</h:inputText>

								<h:outputText value="#{msgs.dateFin}:" />
								<h:inputText
									value="#{manage.serviceClient.sinistreNouvelleDateFin}"
									id="popupButtonDate2">
									<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" />
								</h:inputText>

								<h:outputText value="#{msgs.indemnite}" />
								<p:inputText value="#{manage.serviceClient.nouvelleIndemnite}" />


								<p:commandButton image="ui-icon ui-icon-disk"
									style="width:120px" value="#{msgs.enregistrer}"
									action="#{manage.modifierSinistre}" ajax="false" />
							</h:panelGrid>

						</p:dialog>

					</f:facet>



				</p:dataTable>


			</h:form>


			<h:form>

			</h:form>

		</p:panel>
	</ui:define>

</ui:composition>